// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file home_position.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "home_position.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

home_position::home_position()
{
    // m_timestamp_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f970963
    m_timestamp_ = 0;
    // m_lat_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@61f8bee4
    m_lat_ = 0.0;
    // m_lon_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7b49cea0
    m_lon_ = 0.0;
    // m_alt_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@887af79
    m_alt_ = 0.0;
    // m_x_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fac631b
    m_x_ = 0.0;
    // m_y_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5bc79255
    m_y_ = 0.0;
    // m_z_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@47ef968d
    m_z_ = 0.0;
    // m_yaw_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@23e028a9
    m_yaw_ = 0.0;
    // m_valid_alt_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3dd4520b
    m_valid_alt_ = false;
    // m_valid_hpos_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5ae63ade
    m_valid_hpos_ = false;
    // m_manual_home_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@610694f1
    m_manual_home_ = false;

}

home_position::~home_position()
{











}

home_position::home_position(const home_position &x)
{
    m_timestamp_ = x.m_timestamp_;
    m_lat_ = x.m_lat_;
    m_lon_ = x.m_lon_;
    m_alt_ = x.m_alt_;
    m_x_ = x.m_x_;
    m_y_ = x.m_y_;
    m_z_ = x.m_z_;
    m_yaw_ = x.m_yaw_;
    m_valid_alt_ = x.m_valid_alt_;
    m_valid_hpos_ = x.m_valid_hpos_;
    m_manual_home_ = x.m_manual_home_;
}

home_position::home_position(home_position &&x)
{
    m_timestamp_ = x.m_timestamp_;
    m_lat_ = x.m_lat_;
    m_lon_ = x.m_lon_;
    m_alt_ = x.m_alt_;
    m_x_ = x.m_x_;
    m_y_ = x.m_y_;
    m_z_ = x.m_z_;
    m_yaw_ = x.m_yaw_;
    m_valid_alt_ = x.m_valid_alt_;
    m_valid_hpos_ = x.m_valid_hpos_;
    m_manual_home_ = x.m_manual_home_;
}

home_position& home_position::operator=(const home_position &x)
{

    m_timestamp_ = x.m_timestamp_;
    m_lat_ = x.m_lat_;
    m_lon_ = x.m_lon_;
    m_alt_ = x.m_alt_;
    m_x_ = x.m_x_;
    m_y_ = x.m_y_;
    m_z_ = x.m_z_;
    m_yaw_ = x.m_yaw_;
    m_valid_alt_ = x.m_valid_alt_;
    m_valid_hpos_ = x.m_valid_hpos_;
    m_manual_home_ = x.m_manual_home_;

    return *this;
}

home_position& home_position::operator=(home_position &&x)
{

    m_timestamp_ = x.m_timestamp_;
    m_lat_ = x.m_lat_;
    m_lon_ = x.m_lon_;
    m_alt_ = x.m_alt_;
    m_x_ = x.m_x_;
    m_y_ = x.m_y_;
    m_z_ = x.m_z_;
    m_yaw_ = x.m_yaw_;
    m_valid_alt_ = x.m_valid_alt_;
    m_valid_hpos_ = x.m_valid_hpos_;
    m_manual_home_ = x.m_manual_home_;

    return *this;
}

size_t home_position::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);



    return current_alignment - initial_alignment;
}

size_t home_position::getCdrSerializedSize(const home_position& data, size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);



    return current_alignment - initial_alignment;
}

void home_position::serialize(eprosima::fastcdr::Cdr &scdr) const
{

    scdr << m_timestamp_;
    scdr << m_lat_;
    scdr << m_lon_;
    scdr << m_alt_;
    scdr << m_x_;
    scdr << m_y_;
    scdr << m_z_;
    scdr << m_yaw_;
    scdr << m_valid_alt_;
    scdr << m_valid_hpos_;
    scdr << m_manual_home_;
}

void home_position::deserialize(eprosima::fastcdr::Cdr &dcdr)
{

    dcdr >> m_timestamp_;
    dcdr >> m_lat_;
    dcdr >> m_lon_;
    dcdr >> m_alt_;
    dcdr >> m_x_;
    dcdr >> m_y_;
    dcdr >> m_z_;
    dcdr >> m_yaw_;
    dcdr >> m_valid_alt_;
    dcdr >> m_valid_hpos_;
    dcdr >> m_manual_home_;
}

/*!
 * @brief This function sets a value in member timestamp_
 * @param _timestamp_ New value for member timestamp_
 */
void home_position::timestamp_(uint64_t _timestamp_)
{
m_timestamp_ = _timestamp_;
}

/*!
 * @brief This function returns the value of member timestamp_
 * @return Value of member timestamp_
 */
uint64_t home_position::timestamp_() const
{
    return m_timestamp_;
}

/*!
 * @brief This function returns a reference to member timestamp_
 * @return Reference to member timestamp_
 */
uint64_t& home_position::timestamp_()
{
    return m_timestamp_;
}

/*!
 * @brief This function sets a value in member lat_
 * @param _lat_ New value for member lat_
 */
void home_position::lat_(double _lat_)
{
m_lat_ = _lat_;
}

/*!
 * @brief This function returns the value of member lat_
 * @return Value of member lat_
 */
double home_position::lat_() const
{
    return m_lat_;
}

/*!
 * @brief This function returns a reference to member lat_
 * @return Reference to member lat_
 */
double& home_position::lat_()
{
    return m_lat_;
}

/*!
 * @brief This function sets a value in member lon_
 * @param _lon_ New value for member lon_
 */
void home_position::lon_(double _lon_)
{
m_lon_ = _lon_;
}

/*!
 * @brief This function returns the value of member lon_
 * @return Value of member lon_
 */
double home_position::lon_() const
{
    return m_lon_;
}

/*!
 * @brief This function returns a reference to member lon_
 * @return Reference to member lon_
 */
double& home_position::lon_()
{
    return m_lon_;
}

/*!
 * @brief This function sets a value in member alt_
 * @param _alt_ New value for member alt_
 */
void home_position::alt_(float _alt_)
{
m_alt_ = _alt_;
}

/*!
 * @brief This function returns the value of member alt_
 * @return Value of member alt_
 */
float home_position::alt_() const
{
    return m_alt_;
}

/*!
 * @brief This function returns a reference to member alt_
 * @return Reference to member alt_
 */
float& home_position::alt_()
{
    return m_alt_;
}

/*!
 * @brief This function sets a value in member x_
 * @param _x_ New value for member x_
 */
void home_position::x_(float _x_)
{
m_x_ = _x_;
}

/*!
 * @brief This function returns the value of member x_
 * @return Value of member x_
 */
float home_position::x_() const
{
    return m_x_;
}

/*!
 * @brief This function returns a reference to member x_
 * @return Reference to member x_
 */
float& home_position::x_()
{
    return m_x_;
}

/*!
 * @brief This function sets a value in member y_
 * @param _y_ New value for member y_
 */
void home_position::y_(float _y_)
{
m_y_ = _y_;
}

/*!
 * @brief This function returns the value of member y_
 * @return Value of member y_
 */
float home_position::y_() const
{
    return m_y_;
}

/*!
 * @brief This function returns a reference to member y_
 * @return Reference to member y_
 */
float& home_position::y_()
{
    return m_y_;
}

/*!
 * @brief This function sets a value in member z_
 * @param _z_ New value for member z_
 */
void home_position::z_(float _z_)
{
m_z_ = _z_;
}

/*!
 * @brief This function returns the value of member z_
 * @return Value of member z_
 */
float home_position::z_() const
{
    return m_z_;
}

/*!
 * @brief This function returns a reference to member z_
 * @return Reference to member z_
 */
float& home_position::z_()
{
    return m_z_;
}

/*!
 * @brief This function sets a value in member yaw_
 * @param _yaw_ New value for member yaw_
 */
void home_position::yaw_(float _yaw_)
{
m_yaw_ = _yaw_;
}

/*!
 * @brief This function returns the value of member yaw_
 * @return Value of member yaw_
 */
float home_position::yaw_() const
{
    return m_yaw_;
}

/*!
 * @brief This function returns a reference to member yaw_
 * @return Reference to member yaw_
 */
float& home_position::yaw_()
{
    return m_yaw_;
}

/*!
 * @brief This function sets a value in member valid_alt_
 * @param _valid_alt_ New value for member valid_alt_
 */
void home_position::valid_alt_(bool _valid_alt_)
{
m_valid_alt_ = _valid_alt_;
}

/*!
 * @brief This function returns the value of member valid_alt_
 * @return Value of member valid_alt_
 */
bool home_position::valid_alt_() const
{
    return m_valid_alt_;
}

/*!
 * @brief This function returns a reference to member valid_alt_
 * @return Reference to member valid_alt_
 */
bool& home_position::valid_alt_()
{
    return m_valid_alt_;
}

/*!
 * @brief This function sets a value in member valid_hpos_
 * @param _valid_hpos_ New value for member valid_hpos_
 */
void home_position::valid_hpos_(bool _valid_hpos_)
{
m_valid_hpos_ = _valid_hpos_;
}

/*!
 * @brief This function returns the value of member valid_hpos_
 * @return Value of member valid_hpos_
 */
bool home_position::valid_hpos_() const
{
    return m_valid_hpos_;
}

/*!
 * @brief This function returns a reference to member valid_hpos_
 * @return Reference to member valid_hpos_
 */
bool& home_position::valid_hpos_()
{
    return m_valid_hpos_;
}

/*!
 * @brief This function sets a value in member manual_home_
 * @param _manual_home_ New value for member manual_home_
 */
void home_position::manual_home_(bool _manual_home_)
{
m_manual_home_ = _manual_home_;
}

/*!
 * @brief This function returns the value of member manual_home_
 * @return Value of member manual_home_
 */
bool home_position::manual_home_() const
{
    return m_manual_home_;
}

/*!
 * @brief This function returns a reference to member manual_home_
 * @return Reference to member manual_home_
 */
bool& home_position::manual_home_()
{
    return m_manual_home_;
}


size_t home_position::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
    size_t current_align = current_alignment;














    return current_align;
}

bool home_position::isKeyDefined()
{
   return false;
}

void home_position::serializeKey(eprosima::fastcdr::Cdr &scdr) const
{
    (void) scdr;
     
     
     
     
     
     
     
     
     
     
     
}
